<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>浮动广告</title>
<script type="text/javascript">
    var tips; 
	var theTop = 100/*这是默认高度,越大越往下*/; 
    var old = theTop;
    
    function initFloatTips() {
      tips = document.getElementById("QQFloat");
      moveTips();
    };
    
    function moveTips() {
      var tt=50;
      if (window.innerHeight) {
        pos = window.pageYOffset
      }
      else if (document.documentElement && document.documentElement.scrollTop) {
        pos = document.documentElement.scrollTop
      }
      else if (document.body) {
        pos = document.body.scrollTop;
      }

      pos=pos-tips.offsetTop+theTop;
      pos=tips.offsetTop+pos/10;
     
      if (pos < theTop) pos = theTop;
      if (pos != old) {
        tips.style.top = pos+"px";
	tt=50;
      //alert(tips.style.top);
      }
      old = pos;
      setTimeout(moveTips,tt);
    }
    
      function hide()
     {
     showad=false;
     window.document.getElementById("QQFloat").style.display="none";
     }

 window.onload=initFloatTips;
</script>
</head>
<body>
<div id="QQFloat" style="top:50px;position: absolute;border:dashed 1px #F90;line-height:20px; width:100px;">
浮动广告<br>
浮动广告<br>
浮动广告<br>
浮动广告<br>
浮动广告<br>
浮动广告<br>
浮动广告<br>
浮动广告<br>
<div style="margin:0; background-color:Lime;">
<a href="javascript:;" onclick="hide()" style="color:#000000;text-decoration:underline;font-size:12px;">关闭</a></div>
</div>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p><p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;</p>
</body>
</html>

